<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of YaziBirimiTipi
 *
 * @author Sedat Sevgili
 */
class YaziBirimiTipi {
    //put your code here
    
    const KELIME = 'KELIME';
    const NOKTALAMA = 'NOKTALAMA';
    const BOSLUK = 'BOSLUK';
    const CUMLE = 'CUMLE';
    const PARAGRAF = 'PARAGRAF';
    const DIGER = 'DIGER';
    
    protected $_value;
    
    function __construct($value) {
        if(!in_array($value, $this->_getValues())) {
            $value = self::DIGER;
        }
        $this->_value = $value;
    }
    
    protected function _getValues() {
        return array(
            self::KELIME,
            self::NOKTALAMA,
            self::BOSLUK,
            self::CUMLE,
            self::PARAGRAF,
            self::DIGER
        );
    }
    
    public function __toString() {
        return $this->_value;
    }
    
}